 //预约时间控制
var nowTime=new XDate();
var booktime=new XDate();
var time
getNow(booktime)
$("#btn-prev").click(function(e){
   booktime.addDays(-1);
   var time=nowTime.diffDays(booktime)
   if(time>0){
     $("#btn-prev").removeClass("disable");
	 $("#btn-tomrrow").removeClass("disable");
     getNow(booktime)
	 $("#btn-tomrrow").removeClass("disable")
   }else{
     $("#btn-prev").addClass("disable")
   }
});
$("#btn-next").click(function(e){
   booktime.addDays(1);
   time=nowTime.diffDays(booktime)
   getNow(booktime)
   if(time>0){
     $("#btn-prev").removeClass("disable")
	 $("#btn-tomrrow").removeClass("disable")
   }else{
     $("#btn-prev").addClass("disable")
	 $("#btn-tomrrow").addClass("disable")
   }
})
$('#input-bookingTime').change(function() {
     var num=$('#input-bookingTime').val()
     booktime=new XDate();
	 booktime.addHours(num)
	 getNow(booktime)
     $("#btn-prev").addClass("disable")
	 $("#btn-tomrrow").addClass("disable")
  
});
$('#input-bookingDate').change(function() {
     var num=$('#input-bookingDate').val()
	 booktime.setHours(0);
	 
	 booktime.addHours(num);
	 now=getNow(booktime)
});
$("#datepicker").novaDatePicker({ change: setValue });
function setValue() {
	 var datepicker = $("#datepicker").data("novaDatePicker");
	 booktime=new XDate(datepicker.value());
	 var num=$('#input-bookingDate').val()
	 if(num>0){
	 booktime.setHours(0);
	 booktime.setMinutes(0);
	 booktime.addHours(num);
	 }
	 getNow(booktime)
};
function getNow(e){
	var m=e.toString('MM月 d日  H点mm分');
	$("#selectedTime").html(m);
	}